/*
 * Sky.h
 *
 *  Created on: 21.11.2012
 *      Author: Travis
 */

#pragma once

#include "ShaderPool.h"

#ifdef _WIN32 
#include <windows.h> 
#endif

#include "TexPool.h"
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <string>
#include <vector>
#include "scene/World.h"
#include "engine/engineSettings.h"
#include "engine/RTSException.h"

class Sky
{
public:
	// texture constructor
	// input - high - y position of water surface
	//		 - size - size of water surface
	//		 - path to texture
	//		 - shader pool
	//		 - world class (matrix, light setup etc.)
	Sky(float _high, float _size);
	virtual ~Sky();

	// drwa water surface
	void draw();

	// generate vertex buffer object
	void genVBO();

	// generate uv coord buffer object
	void genUVBO();

	// create normal buffer object
	void genNormalBO();

	// return y position of water surface
	float getHigh();

private:

	// high and size of water surface
	float high, size;

	// texture pool
	TexPool *textures;

	// storede ID
	GLuint shaderID;
	GLuint textureID;
	GLuint VertexArrayID;
	GLuint uvbuffer; // uv buffer ID generated with genUVBO function
	GLuint normalBufferID; // normal buffer identificator

	std::vector<glm::vec3> vertices;
	std::vector<glm::vec2> UVCoord;
	std::vector<glm::vec3> normals;
};

